package cn.com.ctcloud.saas.user.domain;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;

public class UserObj implements Serializable {
	public static final String TABLE_NAME = "T_USER";
	public static final String TABLE_ID = "ID";
	public static final String TABLE_LOGIC_ID = "LOGIC_ID";
	private static final long serialVersionUID = -15404526914910L;
	// 主键
	private String id;
	// 逻辑主键
	private String logicId;
	// 登录名
	private String name;
	// 登录密码
	private String pwd;

	/**
	 * 得到对象的哈希值
	 * 
	 * @return int 对象的哈希值
	 */
	public int hashCode() {
		return new HashCodeBuilder().append(this.getLogicId()).toHashCode();
	}

	/**
	 * 比较两个对象是否相等
	 * 
	 * @param other 要比较的对象
	 * @return boolean 相同返回true，否则返回flase
	 */
	public boolean equals(final Object other) {
		if (!(other instanceof UserObj)) {
			return false;
		}
		final UserObj castOther = (UserObj) other;
		return new EqualsBuilder().append(this.getLogicId(), castOther.getLogicId()).isEquals();
	}

	/**
	 * 返回对象的字符串值
	 * 
	 * @return String 表示用户对象的字符串值
	 */
	public String toString() {
		return new ToStringBuilder(this).append("", this.getLogicId()).toString();
	}

	public String getId() {
		return id;
	}

	public void setId(final String id) {
		this.id = id;
	}

	public String getLogicId() {
		return logicId;
	}

	public void setLogicId(final String logicId) {
		this.logicId = logicId;
	}

	public String getName() {
		return name;
	}

	public void setName(final String name) {
		this.name = name;
	}

	public String getPwd() {
		return pwd;
	}

	public void setPwd(final String pwd) {
		this.pwd = pwd;
	}
}